<table>
  <tr>
    <th>Title</th>
    <th>Period</th>
    <th>Roles</th>
    <th>Administrator</th>
    <th>Edit</th>
    <th>Delete</th>
  </tr>
  <% @laivs.each do |laiv| %>
    <tr>
      <td><%=laiv.title%></td>
      <td><%=laiv.timespan%></td>
      <td><%=link_to "Roles", laiv_roles_path(laiv)%></td>
      <td><%=link_to laiv.administrator.name, 
        :controller => :login, :action => :list_users %></td>
      <td><%=link_to 'Edit', edit_laiv_path(laiv) %></td>
      <td><%=link_to 'Delete', laiv_path(laiv), :method => :delete,
        :confirm => "Deleting a laiv will also delete all associated data (roles, applications etc. Are you sure?" %></td>
    </tr>
  <% end %>
</table>

<%=link_to 'New laiv', new_laiv_path%>
